package com.chapter2json.demo.controller;

import com.chapter2json.demo.pojo.Pet;
import com.chapter2json.demo.pojo.User;
import com.chapter2json.demo.tools.JsonResultObject;
import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.web.bind.annotation.RestController;

@RestController
public class JsonController {
    @RequestMapping("/test")
    public JsonResultObject<User> test() {
        // User对象无法表示请求是成功还是失败，所以请求返回的是封装的对象
        User user1 = new User("gameboy", "23234");
        return new JsonResultObject<User>(user1, "200", "success", "-1", "null");
    }
}
